<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib uri="velcro" prefix="velcro" %>
<%@ page isELIgnored="false" %>

<%!
public class NameValue
{
	private String name;
	private String value;
	
	public NameValue()
	{
	}
	
	public NameValue(String n, String v)
	{
		name = n;
		value = v;
	} 
	
	public String getName()
	{
		return name;
	}
	public void setName(String name)
	{
		this.name = name;
	}
	public String getValue()
	{
		return value;
	}
	public void setValue(String value)
	{
		this.value = value;
	}
	
}
%>

<%
    java.util.List myIngredients = new java.util.ArrayList();
    myIngredients.add(new NameValue("1", "Tak"));
    myIngredients.add(new NameValue("2", "Tram"));
    myIngredients.add(new NameValue("3", "Chi"));
    
%>

<style type='text/css'>
table th
{
	color : blue;
	background-color : gray;
}
</style>

<html>
	<body>
	
		<div style='float:left'>
			<velcro:table data="<%= myIngredients %>" tableId="table1" rawHtml='border="1"'>
				<velcro:column columnId="id" displayName="Name" dataField='name'></velcro:column>
				<velcro:column columnId="name" displayName="Value">
					<c:choose>
						<c:when test='${rowData.value == "Tram"}'>
							<a href='javascript:alert("${rowData.value}")' >Be Tram</a>
						</c:when>
						<c:otherwise>
							<img src="" alt="${rowData.value}" onclick='javascript:alert("Boo!");'/>
						</c:otherwise>
					</c:choose>
				</velcro:column>
			</velcro:table>
		</div>
	</body>
</html>